package com.tnmi.base;

import com.tnmi.utils.MapHelper;

import java.util.Arrays;
import java.util.Map;

/**
 * @version 1.0
 * @Classname BaseEnum
 * @Description TODO
 * @Date 2023/7/2 18:07
 * @Created by tnmi
 **/
public interface BaseEnum {
    static Map<String,String> getMap(BaseEnum[] list){
        return MapHelper.uniqueIndex(Arrays.asList(list), BaseEnum::getCode,BaseEnum::getDesc);
    }

    default String getCode(){
        return toString();
    }

    String getDesc();
}
